skeleton_get_minmax();
Array (4 elements: xMin, yMin, xMax, yMax)
This function will return an array with the total bounding box value for all the individual bounding boxes assigned to a skeleton animation sprite. The returned array will have 4 elements:
- [0] - the minimum x position for all bounding boxes
- [1] - the minimum y position for all bounding boxes
- [2] - the maximum x position for all bounding boxes
- [3] - the maximum y position for all bounding boxes
重要!该函数在试用版(Trial License)产品中不可用。
var frame = skeleton_animation_get_frame(0);
if frame > 0 && frame < 2
{
var box = skeleton_get_minmax();
var ww = (box[2] - box[0]) / 2;
var hh = (box[3] - box[1]) / 2;
part_particles_create(global.p_sys, box[0] + ww, box[1] + hh, global.Stars, 10);
}
The above code will check the current frame of the animation assigned to track 0 and then burst some particles from a point in the middle of the total bounding box for the sprite.